import { HttpClientModule } from '@angular/common/http';
import { NgModule } from '@angular/core';
import { HttpModule } from '@angular/http';
import { BrowserModule } from '@angular/platform-browser';
import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import { MyModule } from './my/my.module';
import { OrdersModule } from './orders/orders.module';
import { Todos } from './stores/todos';

// const storeFactory = (http: Http) => {
//   console.log('store factory')
//   return new OrderStore(http)
// }

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    HttpClientModule,
    HttpModule,
    BrowserModule,

    MyModule, OrdersModule,

    AppRoutingModule,
  ],
  providers: [
    Todos,
    /*{
     provide: OrderStore,
     useFactory: storeFactory,
     deps: [ Http ]
     }*/
  ],
  bootstrap: [ AppComponent ]
})
export class AppModule {
}
